/*!
 * Fichier contenant les methodes pour creer les donnees fusionnees
 * @author Alain Simac-Lejeune
 */

#ifndef FUSIONPROCESSOR_H_
#define FUSIONPROCESSOR_H_

#include <QtXml>
#include <math.h>
#include "highgui.h"
#include "cxcore.h"
#include "cv.h"

#include <fstream>
#include <iostream>
#include <sstream>

/*! \brief Classe fusionprocessor \n
  *	Elle permet d'effectuer les differents calculs de fusion a partir
  *	de l'ensemble des informations extraites.
  *	@author Alain Simac-Lejeune
  */

class fusionprocessor
{

public:
	fusionprocessor();
	~fusionprocessor();
	// global
	double hough_average_line_orientation(CvSeq* list);
	//double hough_lines_focalisation(CvSeq* list);
	double cmvt_orientation(double a1,double a2,double a3,double a4,double c1,double c2);
	double cmvt_intensity(double a1,double a2,double a3,double a4,double c1,double c2);
	double cmvt_percentage(IplImage* masque,CvSize size);
	std::vector<double> color_dominant(IplImage* source);
	double color_luminance(IplImage* source);
	// par objet
	std::vector<int> getIPNumberPointsByObject(CvPoint2D32f *list,int number,std::vector<CvPoint> boundingBox);
	std::vector<double> getFOOrientationByObject(CvPoint2D32f *start,CvPoint2D32f *end,int number,std::vector<CvPoint> boundingBox);
	std::vector<double> getFOIntensityByObject(CvPoint2D32f *start,CvPoint2D32f *end,int number,std::vector<CvPoint> boundingBox);
	std::vector<double> getCompacityByObject(std::vector<CvPoint> boundingBox);
	std::vector<int> getOrientation(std::vector<CvPoint> boundingBox);
	std::vector<int> getVideByObject(std::vector<CvPoint> boundingBox);
	double stip_dispersion(CvPoint2D32f *list, int number);
private:
    inline static double square(int a);
	std::vector<CvPoint> boundingBox;
	std::vector<int> tempInt;
	std::vector<double> tempDouble;
	int compteurBox;
};


#endif /* FUSIONPROCESSOR_H_ */
